# Python 2.6.4
# Project Euler, Problem 101
# Copyright 2010 Talha Zaman

from numpy import *
from numpy.linalg import inv
x = range(1,11)
y = [1-n+n**2-n**3+n**4-n**5+n**6-n**7+n**8-n**9+n**10 for n in x]
tot = 0
for i in range(1,11):
    tot += polyval(inv(vander(x[:i])) * mat(reshape(y[:i], (i,1))), i+1)[0]
print int(tot)
